Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications
set-transaction-state
This procedure changes the current database transaction state for the WebSpeed agent. The database transaction state can have the following values:
NONE— The agent is not in a database transaction.START-PENDING— The agent is currently not in a database transaction, but will start the next request cycle in a database transaction (after the current request completes).ACTIVE— The agent is currently in a database transaction.UNDO-PENDING— The agent is in a database transaction that will be undone before the next request cycle (after the current request completes).COMMIT-PENDING— The agent is in a database transaction that will be committed before the next request cycle (after the current request completes).Location:RETRY-PENDING— The agent is in a database transaction that will be undone before the next request cycle, when a new transaction will be started. (This is equivalent toUNDOandSTARTbefore the next request cycle.)web\objects\web-util.pParameters:INPUT pState AS CHARACTERThe database transaction state to set. Only four of the six database transaction states can be set programatically:
Notes:START-PENDING,UNDO-PENDING,RETRY-PENDING, andCOMMIT-PENDING.
- You can omit
-PENDINGwhen typing state values in your code. For example,STARTis equivalent toSTART-PENDING.- You can only set the transaction state to
START-PENDINGif the current state value isNONE. You can only set the transaction state toUNDO-PENDING’,RETRY-PENDING, andCOMMIT-PENDINGif the current state value isACTIVE. Trying to set the transaction state in any other case results in an error.- If you attempt to start a transaction, and there are no state-aware Web objects created or in existence at the end of the Web request, then the transaction state reverts to
NONEfor the next request.- States of
ACTIVE,UNDO-PENDING,RETRY-PENDINGandCOMMIT-PENDINGall indicate that a database transaction is active.- When you set the transaction state, the new state does not take affect until the start of the next request cycle. It is therefore good practice to set the value near the bottom of your
process-web-request, where you are certain no changes to variables or tables will occur in the current request that you might want undone in a subsequent request.Examples:- If the transaction state is
UNDO-PENDINGorRETRY-PENDING, do not set any undo-able variables or tables, unless their values after the current request completes is unimportant. All changes to these variables and tables are lost at the end of the current Web request, when the current database transaction is undone. Similarly, if you look at the value of these variables and fields during the next request, they will show the old values for the duration of the Web request.
See also:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |